<?php
$deal_slug = pods_url_variable('last');
$deal_cat = new Pod('deal', $deal_slug);
$deal_cat_id = $deal_cat->get_field('camp_cat.id');

$category = new Pod('category');
$category->findRecords('name ASC',-1,"t.is_local=1 OR t.is_daily=1");
$i = 0;
while($category->fetchRecord())
{
  $cat[$i]['id'] = $category->get_field('id');
  $cat[$i]['name'] = $category->get_field('name');
  $i++;
}

$select.= '<select id="pods_form1_camp_cat" class="form pick1 camp_cat pods_field pods_field_camp_cat pods_coltype_pick" name="camp_cat"><option value="">-- Select One --</option>';
foreach($cat as $key=>$value)
{
  if($deal_cat_id == $value['id']){
    $select .= '<option value="'.$value['id'].'" selected="selected"  class="option active">'.$value['name'].'</option>';
  }
  else{
    $select .= '<option value="'.$value['id'].'">'.$value['name'].'</option>';
  }
  
}
$select .= '</select>';
echo $select;
?>